package com.nx.quequ;

import java.util.ArrayDeque;
import java.util.Queue;

public class QueueDemo {

    public static void main(String[] args) {
        Queue<Integer> queue=new ArrayDeque<Integer>();

        for (int i = 0; i < 10; i++) {
            queue.add(i);
            System.out.println(queue);
            if (i%3==2){
                //取出一个元素
                Integer peek = queue.poll();
                System.out.println(queue);
            }

        }



    }
}
